package com.thoughtmechanix.organization.controllers;

import com.thoughtmechanix.organization.events.source.SimpleSourceBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("msg")
public class MessageTestController {

    @Autowired
    SimpleSourceBean simpleSourceBean;

    @GetMapping("send")
    public String send(){
        simpleSourceBean.publishOrgChange("edit","Org123456");
        return "message sended";
    }
}
